#include <iostream>
using namespace std;

/*
    需要多少个模板参数，就写多少个，写多了编译器会报错
*/

template <typename T>

T get_max(T a, T b)
{
    return a > b ? a : b;
}

template <typename T>

T fun(T a, int b)
{
    return a + b;
}

int main()
{
    int a = 10, b = 20;
    double c = 10.5, d = 20.5;

    cout << get_max(a, b) << endl;
    cout << get_max(c, d) << endl;

    cout << fun(a, b) << endl;
    cout << fun(c, b) << endl;
}